package one.stand.mapper;

import one.stand.entity.WxNoticeEntity;
import one.stand.model.BusinessCardModel;
import one.stand.model.CrmSeeRecordModel;
import one.stand.model.SeeRecordModel;
import one.stand.response.CrmCustomerAnalysisRespnse;
import one.stand.response.CustomerAnalysisResponse;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
public interface SeeRecordMapper {
    int delSeeCard(SeeRecordModel record);

    int deleteByPrimaryKey(Integer recordId);

    WxNoticeEntity getSendTemplateInfo(Integer recordId);

    /**
     *
     * crm名片查看记录
     * @param userId 客户id
     * @param entranceType 入口类型
     * @param seeType 查看类型
     * @param myCardId 自己名片id
     * @return
     */
    List<CrmSeeRecordModel> getCrmSeeRecord(@Param("userId") Long userId,@Param("entranceType") Integer entranceType,@Param("seeType") Integer seeType,@Param("myCardId")Integer myCardId);

    /**
     * 客户个人分析
     * @return
     */
    List<CrmCustomerAnalysisRespnse> countCustomerAnalysis(SeeRecordModel record);

    int insertSelective(SeeRecordModel record);

    int isTop(SeeRecordModel record);

    /**
     * 用户名片浏览记录
     */
    List<BusinessCardModel> seeDetail(BusinessCardModel record);

    int isHaveDefaultCard(BusinessCardModel record);

    List<BusinessCardModel> selectDefaultCard(BusinessCardModel record);

    SeeRecordModel selectByPrimaryKey(Integer recordId);

    int selectMaxistop(Integer userId);

    int selectRanking(SeeRecordModel record);

    int updateByPrimaryKeySelective(SeeRecordModel record);


    /**
     *
     * @param cardId 自己的名片id
     * @param userId 客户id
     * @return
     */
    CustomerAnalysisResponse getCustomerAnalysis(@Param("cardId") Integer cardId, @Param("userId") Integer userId, @Param("seeType")Integer seeType,@Param("companyId") Integer companyId);

    Map<String,Object> getPcCount(SeeRecordModel model);

    String getPcPhotos(SeeRecordModel model);

    Map<String,Object> getChangeCount(SeeRecordModel model);

    Integer getChangeCountOne(SeeRecordModel model);

    List<Map<String, Object>> selectPcIndexCustomer(SeeRecordModel model);
}